
<template>
  <avue-crud :option="option"
             :permission="getPermission"
             :data="data"></avue-crud>
</template>
<script>
export default {
  data () {
    return {
      option: {
        column: [{
          label: '姓名',
          prop: 'name'
        }, {
          label: '年龄',
          prop: 'sex'
        }]
      },
      data: [{
        id: 1,
        name: '张三',
        sex: 12,
      }, {
        id: 2,
        name: '李四',
        sex: 20,
      }]
    }
  },
  methods: {
    getPermission (key, row, index) {
      if (key === 'editBtn' && index == 0) {
        return false;
      } else if (key === 'delBtn' && index == 1) {
        return false;
      }
      return true;
    }
  }
}
</script>